package lucid.hrms.management.race;

import java.util.List;

import org.codehaus.grepo.core.annotation.Param;
import org.codehaus.grepo.query.commons.annotation.FirstResult;
import org.codehaus.grepo.query.commons.annotation.GenericQuery;
import org.codehaus.grepo.query.commons.annotation.MaxResults;
import org.codehaus.grepo.query.hibernate.annotation.HibernateQueryOptions;
import org.codehaus.grepo.query.hibernate.repository.ReadWriteHibernateRepository;
import org.springframework.stereotype.Repository;

@Repository("raceRepository")
public interface RaceRepository extends ReadWriteHibernateRepository<Race, Long> {
	@GenericQuery
	@HibernateQueryOptions(criteriaGenerator = RaceCriteriaGenerator.class)
	List<Race> findRaces(@Param("raceCriteria") RaceCriteria raceCriteria, @FirstResult int firstResult, @MaxResults int maxResults);

	@GenericQuery(query = "select count(*) from Race")
	int getTotalRaces();
}